Apply RUSTFLAGS env var to rustc builds
authorBrian Anderson <banderson@mozilla.com>
Wed, 17 Feb 2016 00:48:03 +0000 (00:48 +0000)
committerBrian Anderson <banderson@mozilla.com>
Wed, 16 Mar 2016 16:49:21 +0000 (16:49 +0000)
commite17933ec7f753520fe3368647b0d10f1cfc6c22c
tree52c3a7b1494d1eaad846d925a78612b343ec53be
parentc3b571f3937d638ead1421a17b74a71aa5612611
Apply RUSTFLAGS env var to rustc builds

This passes RUSTFLAGS to rustc builds for the target architecture.

We don't want to pass the RUSTFLAGS args to multiple architectures because
they may contain architecture-specific flags. Ideally, the scheme
we would use would treat plugins and build scripts - which may not
be for the target architecture - consistently. Unfortunately it's
quite difficult in the current Cargo architecture to seperately
identify build scripts, plugins and their dependencies from
code used by the target.

So the scheme here is very simple:

1) If --target is not specified, RUSTFLAGS applies to all builds.
2) If --target is specified, RUSTFLAGS only applies to builds
   with the Kind::Target target kind, which indicates build units
   derived from the requested --target.

Closes #2112
Cargo.lock
src/cargo/ops/cargo_rustc/context.rs
src/cargo/ops/cargo_rustc/mod.rs
tests/test_cargo_compile.rs